<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$content = new Models_Tags();
$valid = $content->validateTag($_POST);
if($valid)
{
    foreach ($valid as $error)
    {
        require_once 'edittag.php';
        echo '<div class="alert alert-danger"><h4>' . $error . '</h4></div>';
    } 
} else {
    $content->editTag($id,$_POST);
    echo '<div class="alert alert-success"><h4>Succesful.</h4> <a href="/admin" class="btn btn-success">Back</a></div>';
}
?>